package Java.jvm;

import java.util.ArrayList;
import java.util.List;

public class HeapOOM {
    public static void main(String[] args) {
        List<OOMObject> list = new ArrayList<>();
        int i = 1;
        while (true) {
            list.add(new OOMObject());
            System.out.println("增加第" + i++ + "个对象");
        }
    }

    static class OOMObject {

    }
}

